import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
// 新闻， 新闻详情组件
import News from '../views/News.vue'
import NewsDetail from "../views/NewsDetail.vue"
// 图片列表， 详情组件
import ImageList from '../views/ImageList.vue'
import ImageDetail from '../views/ImageInfo.vue'
// 搜索组件
import Search from '../views/search.vue'
// 添加商品 组件
import AddGoods from '../views/AddGoods.vue'
// 商品相关组件
import Goods from '../views/Goods.vue'
import GoodsDetail from '../views/GoodsDetail.vue'
import GoodsDesc from '../views/Goodsdesc.vue'
import GoodsComment from '../views/GoodsComment.vue'
// 购物车
import Cart from '../views/Cart.vue'
// 会员页面
import Member from '../views/member.vue'

Vue.use(VueRouter)


const router = new VueRouter({
  routes: [
    { path: "/", redirect: "/home" },
    { path: "/home", component: Home },
    { path: "/member", component: Member },
    { path: "/newslist", component: News },
    { path: "/news/detail/:id", component: NewsDetail, props: true },
    { path: "/photo/list", component: ImageList },
    { path: "/photo/Info/:id", component: ImageDetail, props: true },
    { path: "/search", component: Search },
    { path: "/addgoods", component: AddGoods },
    { path: "/goods/list", component: Goods },
    { path: "/goods/detail/:id", component: GoodsDetail, props: true },
    { path: "/goodsdesc/:id", component: GoodsDesc, props: true },
    { path: "/goodscomments/:id", component: GoodsComment, props: true },
    { path: "/cart", component: Cart },
  ]
})

export default router
